/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.asu.cse360.client.util;

import edu.asu.cse360.client.ui.frame.AppFrame;
import edu.asu.cse360.client.ui.frame.EmployeeEditPanel;
import edu.asu.cse360.client.ui.frame.ItemEfficiencyPanel;
import edu.asu.cse360.client.ui.frame.MenuEditPanel;
import edu.asu.cse360.client.ui.frame.StaffEfficiencyPanel;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JMenu;

/**
 * THis loads the Manager Configurations information
 * @author nadimhoque
 */
public class ManagerConfiguration extends AppConfiguration{
    private EmployeeEditPanel employeeEditPanel = EmployeeEditPanel.instance();
    private MenuEditPanel meuEditPanel = MenuEditPanel.instance();

    private ManagerConfiguration(){}
    private static ManagerConfiguration instance;
    public static ManagerConfiguration instance(){
        if(instance == null){
            instance = new ManagerConfiguration();
        }
        return instance;
    }

    @Override
    public void configure(AppFrame frame) {
        frame.showCard("managerCard");
        addMenuBar(frame);
        if(!hasConfiguredAppFrame){
            addPanels(frame);
            hasConfiguredAppFrame = true;
        }
        meuEditPanel.refreshModel();
        employeeEditPanel.refresh();
    }

    protected List<JMenu> getMenus(AppFrame frame){
        List<JMenu> menus = new ArrayList<JMenu>();
       // menus.add(getSettingsMenu());
        menus.add(getHelpMenu());
        menus.add(getAdminMenu(frame));
        return menus;
    }

    private void addPanels(AppFrame frame) {
        addPanel(frame.getMenuEditContainer(), meuEditPanel);
        addPanel(frame.getMenuReportContainer(), new ItemEfficiencyPanel());
        addPanel(frame.getStaffReportContainer(), new StaffEfficiencyPanel());
        addPanel(frame.getStaffEditContainer(), employeeEditPanel);
    }
    
}
